const mongoose = require('mongoose');
const { Article } = require('../../model/article')

module.exports = async (req, res) => {
    var id = req.params.id
    var classify = req.fields.class
    var updateDate = new Date()
    try {
        var data = await Article.updateOne({ _id: id }, {class:classify,updateDate})
    } catch {
        return res.send({
            data: null,
            meta: {
                status: 403,
                msg: '修改失败'
            }
        })
    }
    res.send({
        data: null,
        meta: {
            status: 203,
            msg: '修改成功'
        }
    })


}